home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_051 / difssed / difssed.doc < prev    next >
Text File  |  1992-05-06  |  5KB  |  112 lines

  1. These are the famous "dif" and "ssed" programs which were originally
  2. written for CP/M by Chuck Forsberg.  Together they provided a very
  3. convenient way to distribute updates to public domain source programs
  4. that was MUCH more efficient than re-uploading the entire new source
  5. program.  As a fringe benefit, they can be used as the basis for a
  6. source librarian which keeps track of all changes to a system.
  7.  
  8. As the name implies, "dif" produces a "difference" file which lists the
  9. line-by-line differences between any two text files.  It's output can also
  10. be used to check the differences between two files in cases where you
  11. are not sure just what changes you last made.  An option (-e) will
  12. cause dif to produce a file of editing commands for it's companion
  13. program "ssed".  Given the original source file and the command file
  14. produced by dif, ssed can produce the new source file automatically.
  15. A quick example:
  16.  
  17. Assume that you have a source file named "main.c" that you wish to update.
  18. Being prudent (You ARE prudent, aren't you?), you copy "main.c" to
  19. "main.old" as backup before beginning your update.  At some point, you
  20. have completed testing the new version of "main.c" and wish to send the
  21. update to a friend who has a copy of the original "main.c".  You run the
  22. following:
  23.  
  24.     dif -e main.old main.c main.dif
  25.  
  26. This creates "main.dif" which contains ONLY concise commands to ssed
  27. which reflect the changes you made to "main.c".  You send this
  28. "difference" file to your friend who runs the following:
  29.  
  30.     ssed main.c main.dif main.new
  31.  
  32. At the completion of this run, "main.new" will be an exact copy of your
  33. new "main.c" file.  Voila!
  34.  
  35.  
  36. Dif uses an 8k circular buffer for each of it's input files and thus
  37. performs a somewhat intelligent search for matching lines within this
  38. 8k limit.  What this means to you is that dif will be unable to handle
  39. cases where a single change spans more than 8k.  If, during an update
  40. for instance, you added a new subroutine which was more than 8k in
  41. length, dif will be unable to handle it.  In *very* rare case, it is
  42. possible for dif to get out of synch.  For instance, if an update
  43. included NEW lines which happened to accidentally EXACTLY match lines
  44. which also exist in the original file, then dif could get out of synch
  45. and begin reporting ALL lines as changed.  If dif DOES manage to
  46. complete normally, then the resulting file WILL work when run through
  47. ssed...the out-of-synch condition just might have caused the "diff"
  48. file to be bigger than the original source file!
  49.  
  50. Dif and ssed utilize a CRC checking algorithm to ensure that one
  51. does not inadvertently update an incorrect antecedant file.  For
  52. instance, if you have "main.realold", "main.old" and "main.new"
  53. and run dif on "main.old" and "main.new" producing "main.dif", "main.dif"
  54. will include CRC values of the "main.old" lines.  This will guarantee
  55. that you cannot apply "main.dif" to "main.realold" by accident.  If
  56. you do, ssed will report "incorrect antecedant" and quit (unless you
  57. tell ssed to "ignore CRC" errors).
  58.  
  59. As a convenience, both dif and ssed have options which allow the
  60. input file to be in SQueezed format.  This simply means that if
  61. you habitually archive source programs in SQueezed format, you don't
  62. have to UNSQueeze before running these utilities.
  63.  
  64. Command line format and usage for dif:
  65.  
  66.     dif {<newfile} {>outfile} [-deuv] oldfile [newfile] [outfile]
  67.         -d    display lines that match
  68.         -e    generate SSED editor script
  69.         -u    unsqueeze oldfile
  70.         -v    verbose
  71.  
  72.     If "newfile" is omitted, then dif reads from Standard Input.
  73.     If "outfile" is omitted, then dif writes to Standard Output.
  74.     Notes: Standard IN and OUT are shown being re-directed in curly
  75.            braces in the above example.  The curly braces are intended
  76.            to show that the re-direction is optional.  Redirection
  77.            only works, of course, if the respective parameter was
  78.            omitted.
  79.            If you omit "newfile", then "outfile" MUST be omitted...
  80.            parameters are positional!
  81.  
  82. Command line format and usage for ssed:
  83.  
  84.     ssed {<cmdfile} {>outfile} [-iuv] infile [cmdfile] [outfile]
  85.         -i    ignore CRC errors
  86.         -u    unsqueeze infile
  87.         -v    verbose
  88.  
  89.     If "cmdfile" is omitted, then ssed reads commands from Standard Input.
  90.     If "outfile" is omitted, then ssed writes to Standard Output.
  91.     Notes: Standard IN and OUT are shown being re-directed in curly
  92.            braces in the above example.  The curly braces are intended
  93.            to show that the re-direction is optional.  Redirection
  94.            only works, of course, if the respective parameter was
  95.            omitted.
  96.            If you omit "cmdfile", then "outfile" MUST be omitted...
  97.            parameters are positional!
  98.  
  99. Dif and Ssed were originally written for CP/M by:
  100.     Chuck Forsberg
  101.     Omen Technology Inc
  102.     Rt 1 Box 120v Portland OR 97231
  103.     Compuserve: 70715,131
  104.  
  105. Conversion to the Amiga done by:
  106.     Rick Schaeffer
  107.     E. 13611 26th Ave.
  108.     Spokane, Wa.  99216
  109.     Compuserve: 70120,174
  110.     Bix:        ricks.
  111.     Usenet:     ihnp4!tektronix!reed!iscuva!ricks
  112.